import React from 'react';
import "./table_postDetails.scss"
import { withRouter } from 'react-router-dom';
import { Tooltip, Progress } from "antd";

const Table_postDetais = (props) => {

    let postObj = props.postObj ? props.postObj : {};

    let status = window.sessionStorage.getItem('status');

    return (
        <div id="table_content">
            {
                status==="student" || props.statuss!=="1"?null:
                <div className="title">
                    <span className="text">
                        添加岗位能力
                    </span>
                    <span className="goPost" onClick={() => props.history.push("/home/post")} >返回</span>
                    <span className="goPost" onClick={() => postObj.stationVersionId && props.getDataedList(postObj.stationVersionId)} >提交审核</span>
                </div>
            }
            <div className="title">
                <span className="text">
                    基本信息
                    </span>
                {
                    status==="student" || props.statuss!=="1"?
                    <span className="goPost" onClick={() => props.history.push("/home/post")} >返回</span>:
                    <span className="goPost" onClick={() => {}} >编辑</span>
                }
            </div>
            <div className="detail">
                <span>岗位名称：{postObj.name ? postObj.name : ""}</span>
                <span>专业：{postObj.majorName ? postObj.majorName : ""}</span>
                <span>版本号：{postObj.stationVersion ? postObj.stationVersion : ""}</span>
                <span>作者：{postObj.userName ? postObj.userName : ""}</span>
            </div>
            <div className="tableBox">
                <div className="table">
                    <div className="column">
                        <div className="rowLeft">
                            薪酬范围*
                            </div>
                        <div className="row">
                            <Tooltip title="3 done / 3 in progress / 4 to do">
                                <Progress percent={60} success={{ percent: 30 }} />
                            </Tooltip>
                        </div>
                    </div>
                    <div className="column">
                        <div className="rowLeft">
                            岗位描述*
                            </div>
                        <div className="row">
                            {
                                postObj.stationLevelList && postObj.stationLevelList.map((item, index) => {
                                    return <div key={index} className="rowItem">
                                        {item.describes}
                                    </div>
                                })
                            }
                        </div>
                    </div>
                    <div className="column">
                        <div className="rowLeft">
                            岗位任务
                            </div>
                        <div className="row">
                            {
                                postObj.stationLevelList && <span>{postObj.stationLevelList[0].stationTask}</span>
                            }
                        </div>
                    </div>
                </div>
            </div>
        </div>
    );
};

export default withRouter(Table_postDetais);